﻿using System;
using DevExpress.XtraEditors.DXErrorProvider;
using System.Windows.Forms;
using System.Drawing;

namespace MMS
{
    public class UnitDTO : IDXDataErrorInfo
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the UnitDTO class.
		/// </summary>
		public UnitDTO()
		{
		}

		/// <summary>
		/// Initializes a new instance of the UnitDTO class.
		/// </summary>
		public UnitDTO(string id, string unitName, string note)
		{
			this.Id = id;
			this.UnitName = unitName;
			this.Note = note;
		}



        public void GetPropertyError(System.String propertyName, DevExpress.XtraEditors.DXErrorProvider.ErrorInfo info)
        {
            if (propertyName == "UnitName" && UnitName == "")
            {
                //string strConvention = "Tên đơn vị";
                //info.ErrorText = String.Format("{0} không được rỗng", strConvention);
                info.ErrorText = MessageBundle.ERROR_EMPTY_FIELD.Value;
                
            }
           
        }

        public void GetError(DevExpress.XtraEditors.DXErrorProvider.ErrorInfo info)
        {
           
        }
		#endregion

		#region Properties
		/// <summary>
		/// Gets or sets the Id value.
		/// </summary>
		public string Id { get; set; }

		/// <summary>
		/// Gets or sets the UnitName value.
		/// </summary>
		public string UnitName { get; set; }

		/// <summary>
		/// Gets or sets the Note value.
		/// </summary>
		public string Note { get; set; }

		#endregion
	}
}
